<!--
*Author：富行天下团队

 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/Product/Products.js此处编写
 -->
<template>
  <div>
    <view-grid ref="grid" :columns="columns" :detail="detail" :editFormFields="editFormFields" :editFormFileds="editFormFields" :editFormOptions="editFormOptions"
      :searchFormFields="searchFormFields" :searchFormFileds="searchFormFields" :searchFormOptions="searchFormOptions" :table="table" :extend="extend">
    </view-grid>
  </div>
</template>
<script>
import extend from '@/extension/Product/ProductsPull.js'
import ViewGrid from '@/components/basic/ViewGrid.vue'
var vueParam = {
  components: {
    ViewGrid,
  },
  data() {
    return {
      table: {
        key: 'id',
        footer: 'Foots',
        cnName: '产品拉取',
        name: 'proPull',
        url: '/proPull/',
        sortName: 'createDate',
      },
      extend: extend,
      editFormFields: {
        agreementname: '',
        pointsId: '',
        agreementid: '',
        couponType: '',
        couponcardCode: '',
        couponcardName: '',
        restaurant_ID: '',
        timeContainer: [],
        name: '',
        pics: [],
        type: [],
        typename: '',
        name2: '',
        code: '',
        costprice: '',
        effectiveStartDate: '',
        effectiveEndDate: '',
        unit: '',
        mainLabel: '',
        auxiliaryLabel: '',
        pmsRoomCode: '',
        hotel_ID: '',
        picid: [],
        isPackage: '',
        txtid: '',
        deposit: '',
        bookingNotice: '',
        rulesOfUse: '',
        description: '',
        creator: '',
        createID: '',
        createDate: '',
        modifier: '',
        modifyID: '',
        modifyDate: '',
        merchantCode: '',
        merchantName: '',
        teachingGrade: '',
        teachingTime: '',
        supplierCode: '',
        campsiteName: '',
        regular_bus_id: '',
        venueName: '',
        tube_code: '',
        screen_code: '',
        tubename: '',
        stockTotal: '',
        campUnitId: '',
        cinemascreenid: '',
        isInvoicing: 0,
        receiptInformation: '',
        taxRate: '',
      },
      editFormOptions: [
        [
          {
            dataKey: 'mall_supplier',
            data: [],
            title: '供应商',
            required: true,
            colSize: 4,
            field: 'supplierCode',
            type: 'select',
          },
          {
            title: '供应商名称',
            field: 'supplierName',
            colSize: 4,
            hidden: true,
            disabled: true,
          },
          {
            dataKey: 'tree_protype',
            data: [],
            title: '产品类型',
            required: true,
            colSize: 4.5,
            field: 'type',
            type: 'cascader',
            changeOnSelect: true,
            cascaderValue: true,
          },
          {
            title: '产品类型',
            field: 'typename',
            colSize: 4,
            hidden: true,
            disabled: true,
          },
          //{"title":"简称","field":"name2","colSize":3,"type":"text"},
          {
            dataKey: 'pointsId',
            data: [],
            title: '供应商点位',
            field: 'pointsId',
            colSize: 3,
            type: 'select',
            required: false,
          },
        ],
        [
          {
            title: '名称',
            required: true,
            field: 'name',
            colSize: 6,
            type: 'text',
          },
          {
            title: '有效时间',
            required: true,
            field: 'timeContainer',
            colSize: 5,
            type: 'datetime',
            range: true,
          },
        ],
        [
          {
            title: '有效开始时间',
            field: 'effectiveStartDate',
            colSize: 3,
            type: 'datetime',
            hidden: true,
          },
          {
            title: '有效结束时间',
            field: 'effectiveEndDate',
            colSize: 3,
            type: 'datetime',
            hidden: true,
          },
        ],
        [
          {
            title: '成本价',
            required: true,
            field: 'costprice',
            colSize: 2.5,
            type: 'decimal',
          },
          {
            dataKey: 'unit',
            data: [],
            title: '单位',
            required: false,
            field: 'unit',
            colSize: 2.5,
            type: 'select',
          },
          {
            dataKey: 'Label',
            data: [],
            title: '主标签',
            field: 'mainLabel',
            colSize: 3,
            type: 'select',
          },
          {
            dataKey: 'Label',
            data: [],
            title: '辅助标签',
            field: 'auxiliaryLabel',
            colSize: 3,
            type: 'selectList',
          },
        ],
        [
          {
            title: 'pms房价码',
            field: 'pmsRoomCode',
            colSize: 6,
            type: 'alphanumeric',
            hidden: true,
            required: true,
          },
          {
            dataKey: 'Hotels',
            data: [],
            title: '酒店',
            field: 'hotel_ID',
            colSize: 6,
            type: 'select',
            hidden: true,
            required: true,
          },
          {
            dataKey: 'Campsite_Name',
            data: [],
            title: '营地',
            field: 'campsiteName',
            colSize: 6,
            type: 'select',
            hidden: true,
            required: true,
          },
          {
            title: '营位ID',
            field: 'campUnitId',
            colSize: 6,
            type: 'text',
            hidden: true,
          },
          {
            dataKey: 'regularbus',
            data: [],
            title: '路线',
            field: 'regular_bus_id',
            colSize: 6,
            type: 'select',
            hidden: true,
            required: true,
          },
          {
            dataKey: 'accountType',
            data: [],
            title: '账户类型',
            field: 'couponType',
            colSize: 3,
            type: 'select',
            hidden: true,
            required: true,
          },
          {
            dataKey: '',
            data: [],
            title: '模板',
            field: 'couponcardName',
            colSize: 3,
            type: 'select',
            hidden: true,
          },
          {
            dataKey: '',
            data: [],
            title: '列表',
            field: 'couponcardCode',
            colSize: 3,
            type: 'select',
            hidden: true,
          },
          {
            dataKey: 'Venue_Name',
            data: [],
            title: '影院',
            field: 'venueName',
            colSize: 6,
            type: 'select',
            hidden: true,
            // required: true,
          },
          {
            dataKey: '',
            data: [],
            title: '场次',
            field: 'cinemascreenid',
            colSize: 6,
            type: 'select',
            hidden: true,
            // required: true,
          },
          {
            dataKey: 'Tube_Trees',
            data: [],
            title: '场馆',
            field: 'tube_code',
            colSize: 6,
            type: 'select',
            hidden: true,
            required: true,
          },
          {
            data: [],
            title: '场馆子级',
            field: 'screen_code',
            colSize: 6,
            type: 'select',
            hidden: true,
            required: true,
            disabled: true,
          },
          //    {"title":"场馆","field":"tubename","colSize":6 ,"hidden":true,"disabled":true},
          {
            dataKey: 'attr_jxdj',
            data: [],
            title: '教学等级',
            field: 'teachingGrade',
            colSize: 6,
            type: 'select',
            hidden: true,
            required: true,
          },
          {
            field: 'teachingTime',
            title: '教学时长',
            colSize: 6,
            type: 'number',
            min: 0,
            hidden: true,
            required: true,
          },
        ],
        [
          {
            title: '封面图',
            maxSize: 1,
            field: 'picid',
            colSize: 3,
            type: 'imgupgrade',
            img: true,
            maxFile: 1,
            multiple: true,
          },
          {
            title: '轮播图',
            maxSize: 1,
            field: 'pics',
            colSize: 6,
            type: 'imgupgrade',
            maxFile: 5,
            multiple: true,
          },
        ],
        [
          {
            dataKey: 'enable',
            data: [],
            title: '是否开发票',
            field: 'isInvoicing',
            colSize: 2,
            type: 'switch',
          },
          {
            type: 'select',
            dataKey: 'InvoicingName',
            data: [],
            title: '开票信息',
            field: 'receiptInformation',
            colSize: 4,
            hidden: true,
            required: false,
          },
          {
            title: '税率',
            field: 'taxRate',
            colSize: 3,
            hidden: true,
            type:'textAppend',
            cont: '%',
          },
        ],
        // {"title":"宣传视频","field":"video","colSize":3,"type":"img"},
        [
          {
            title: '押金',
            field: 'deposit',
            colSize: 5,
            type: 'decimal',
            min: 0,
          },
          {
            title: '餐厅名称',
            field: 'restaurant_ID',
            colSize: 5,
            type: 'select',
            dataKey: 'Restaurant',
            data: [],
            hidden: true,
          },
          {
            dataKey: 'enable',
            data: [],
            title: '是否套票项',
            field: 'isPackage',
            colSize: 2,
            type: 'switch',
          },
          {
            field: 'stockTotal',
            title: '总库存',
            type: 'decimal',
            align: 'left',
            colSize: 5,
            min: 0,
          },
        ],
        [
          {
            dataKey: 'mall_test',
            data: [],
            title: '详情介绍',
            required: true,
            field: 'txtid',
            colSize: 6,
            type: 'select',
          },
          {
            title: '预订须知',
            field: 'bookingNotice',
            colSize: 6,
            type: 'select',
            dataKey: 'mall_book',
            data: [],
            required: true,
          },
        ],
        [
          {
            dataKey: 'mall_test',
            data: [],
            title: '免责声明',
            field: 'agreementid',
            colSize: 6,
            type: 'select',
          },
        ],
        [
          {
            title: '使用规则',
            field: 'rulesOfUse',
            colSize: 12,
            type: 'textarea',
          },
        ],
        [
          {
            title: '描述',
            required: false,
            field: 'description',
            colSize: 12,
            type: 'textarea',
          },
        ],
      ],
      searchFormFields: {
        effectiveState: '',
        goodcode: '',
        name: '',
        typename: '',
        createDate: '',
        mainLabel: '',
        unit: '',
        description: '',
        timeContainer: '',
      },
      searchFormOptions: [
        [
          { field: 'name', title: '产品名称', type: 'like' },
          {
            dataKey: 'mall_supplier',
            data: [],
            title: '供应商',
            field: 'supplierCode',
            type: 'select',
          },
          {
            field: 'type',
            title: '产品类型',
            type: 'cascader',
            dataKey: 'tree_protype',
            data: [],
          },
          { field: 'createDate', title: '创建时间', type: 'date' },
        ],
        [
          {
            field: 'mainLabel',
            title: '主标签',
            type: 'select',
            dataKey: 'Label',
            data: [],
          },
          {
            field: 'unit',
            title: '单位',
            type: 'select',
            dataKey: 'unit',
            data: [],
          },
          { field: 'description', title: '描述', type: 'like' },
          { field: 'timeContainer', title: '有效时间', type: 'datetime' },
        ],
        [
          { field: 'goodcode', title: '商品编码', type: 'like' },
          {
            dataKey: 'ProductValidityStatus',
            data: [],
            title: '是否有效',
            field: 'effectiveState',
            type: 'select',
          },
        ],
      ],
      columns: [
        {
          field: 'name',
          title: '产品名称',
          type: 'string',
          width: 120,
          require: true,
          align: 'left',
          sortable: true,
          show: true,
        },
        {
          field: 'code',
          title: '产品编码',
          type: 'string',
          width: 140,
          require: true,
          align: 'left',
          show: true,
        },
        {
          field: 'type',
          title: '产品类型',
          type: 'string',
          bind: { key: 'pro_type', data: [] },
          width: 120,
          require: true,
          align: 'left',
          hidden: true,
          show: true,
        },
        {
          field: 'supplierCode',
          title: '供应商编码',
          type: 'string',
          width: 120,
          align: 'left',
          hidden: true,
        },
        {
          field: 'typename',
          title: '产品类型',
          type: 'string',
          bind: { key: 'enable', data: [] },
          width: 120,
          align: 'left',
        },
        //{field:'name2',title:'简称',type:'string',width:80,require:true,align:'left'},
        {
          field: 'costprice',
          title: '成本价',
          type: 'decimal',
          width: 80,
          align: 'left',
        },
        {
          field: 'effectiveStartDate',
          title: '开始时间',
          type: 'datetime',
          width: 160,
          align: 'left',
          sortable: true,
        },
        {
          field: 'effectiveEndDate',
          title: '结束时间',
          type: 'datetime',
          width: 160,
          align: 'left',
          sortable: true,
        },
        {
          field: 'deposit',
          title: '押金',
          type: 'decimal',
          width: 80,
          align: 'left',
        },
        {
          field: 'pmsRoomCode',
          title: 'pms房价码',
          type: 'string',
          hidden: true,
          width: 110,
          align: 'left',
        },
        {
          field: 'hotel_ID',
          title: '酒店名称',
          type: 'string',
          hidden: true,
          bind: { key: 'Hotels', data: [] },
          width: 160,
          align: 'left',
        },
        {
          field: 'unit',
          title: '单位',
          type: 'int',
          bind: { key: 'unit', data: [] },
          width: 60,
          align: 'left',
          hidden: true,
        },
        {
          field: 'mainLabel',
          title: '主标签',
          type: 'string',
          bind: { key: 'Label', data: [] },
          width: 110,
          align: 'left',
          hidden: true,
        },
        {
          field: 'unitname',
          title: '单位名称',
          type: 'string',
          width: 80,
          hidden: true,
          align: 'left',
        },
        {
          field: 'mainLabelname',
          title: '主标签名称',
          type: 'string',
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'auxiliaryLabelname',
          title: '辅助标签名称',
          type: 'string',
          width: 260,
          hidden: true,
          align: 'left',
        },
        {
          field: 'picid',
          title: '封面图',
          type: 'imgupgrade',
          width: 80,
          align: 'left',
        },
        {
          field: 'isPackage',
          title: '是否套票项',
          type: 'sbyte',
          bind: { key: 'enable', data: [] },
          width: 100,
          hidden: true,
          align: 'left',
        },
        {
          field: 'stockTotal',
          title: '总库存',
          type: 'decimal',
          width: 80,
          align: 'left',
          min: 0,
        },
        {
          field: 'saleStock',
          title: '剩余库存',
          type: 'decimal',
          width: 80,
          align: 'left',
          min: 0,
        },
        {
          field: 'txtidname',
          title: '详情介绍',
          type: 'string',
          width: 220,
          align: 'left',
          show: true,
        },
        //{field:'txtid',title:'图文介绍',type:'string',bind:{ key:'mall_test',data:[]},width:160,align:'left'},
        {
          field: 'bookingNoticeName',
          title: '预订须知',
          type: 'string',
          width: 80,
          align: 'left',
          show: true,
        },
        {
          field: 'rulesOfUse',
          title: '使用规则',
          type: 'string',
          width: 100,
          hidden: true,
          align: 'left',
          show: true,
        },
        {
          field: 'description',
          title: '描述',
          type: 'string',
          width: 100,
          align: 'left',
          show: true,
        },
        {
          field: 'supplierName',
          title: '供应商名称',
          type: 'string',
          width: 180,
          align: 'left',
          show: true,
        },
        {
          field: 'auxiliaryLabel',
          title: '辅助标签',
          type: 'string',
          width: 260,
          align: 'left',
          hidden: true,
        },
        {
          field: 'modifyID',
          title: '修改人ID',
          type: 'int',
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'spare10',
          title: '扩展字段1',
          type: 'string',
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'spare11',
          title: '扩展字段1',
          type: 'string',
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'spare12',
          title: '扩展字段1',
          type: 'string',
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'spare13',
          title: '扩展字段1',
          type: 'string',
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'spare15',
          title: '扩展字段1',
          type: 'string',
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'spare4',
          title: 'spare4',
          type: 'string',
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'spare7',
          title: '扩展字段1',
          type: 'string',
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'spare8',
          title: '扩展字段1',
          type: 'string',
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'spare9',
          title: '扩展字段1',
          type: 'string',
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'txtidname',
          title: '富文本名称',
          type: 'string',
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'spare14',
          title: '扩展字段1',
          type: 'string',
          width: 120,
          hidden: true,
          align: 'left',
        },
       
        {
          field: 'creator',
          title: '创建人',
          type: 'string',
          width: 100,
          align: 'left',
          show: true,
        },
        {
          field: 'createDate',
          title: '创建时间',
          type: 'datetime',
          width: 160,
          align: 'left',
          sortable: true,
        },
        {
          field: 'createID',
          title: '创建人ID',
          type: 'int',
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'modifier',
          title: '修改人',
          type: 'string',
          width: 100,
          align: 'left',
          show: true,
        },
        {
          field: 'modifyDate',
          title: '修改时间',
          type: 'datetime',
          width: 160,
          align: 'left',
          sortable: true,
        },
        {
          field: 'merchantCode',
          title: '商户编码',
          type: 'string',
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'carouselCode',
          title: '轮播图code',
          type: 'string',
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'merchantName',
          title: '商户名称',
          type: 'string',
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'hotelName',
          title: '酒店名称',
          type: 'string',
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'id',
          title: '主键',
          type: 'string',
          width: 120,
          hidden: true,
          readonly: true,
          require: true,
          align: 'left',
        },
        {
          field: 'isAvailable',
          title: '是否可用',
          type: 'sbyte',
          width: 120,
          hidden: true,
          align: 'left',
        },
        {
          field: 'isDelete',
          title: '是否删除',
          type: 'int',
          width: 120,
          hidden: true,
          require: true,
          align: 'left',
        },
      ],
      detail: {
        cnName: '商品管理',
        columns: [
          {
            field: 'name',
            title: '商品名称',
            type: 'string',
            width: 120,
            align: 'left',
            hidden: false,
            require: true,
            edit: { type: 'text', required: true },
          },
          {
            field: 'site_code',
            title: 'site_code',
            type: 'string',
            width: 120,
            align: 'left',
            hidden: true,
            // require: true,
          },
          // 商品新建有问题，暂时注掉必填，后端要求新建时不传商品编码，编辑时要传，商品编码是后端生成的
          {
            field: 'code',
            title: '商品编码',
            type: 'string',
            width: 190,
            align: 'left',
            hidden: true,
            // require: true,
          },
          {
            field: 'offlineCode',
            title: '线下编码',
            type: 'string',
            width: 120,
            align: 'left',
            hidden: false,
            edit: { type: 'text' },
          },
          // { field: 'houseType',title:'房型',type:'select',width:150,align:'left',bind:{ key:'',data:[]}, hidden: true},
          // { field: 'timeContainer',title:'时间',type: "string", width: 180, align: 'left', hidden: true},
          {
            field: 'timeContainer',
            title: '时间',
            type: 'is-range',
            width: 150,
            align: 'left',
            hidden: true,
            edit: { type: 'is-range', keep: true, required: true },
          },
          {
            field: 'spare8',
            title: '是否跨天',
            type: 'int',
            width: 100,
            hidden: true,
            edit: { type: 'switch', keep: true },
          },
          {
            field: 'spare15',
            title: '房型',
            type: 'string',
            width: 120,
            align: 'left',
            hidden: true,
          },
          {
            field: 'originalPrice',
            title: '门市价',
            type: 'string',
            width: 90,
            align: 'left',
            sortable: true,
            hidden: false,
            edit: { type: 'text', required: true },
          },
          {
            field: 'preferentialPrice',
            title: '优惠价',
            type: 'string',
            width: 90,
            align: 'left',
            hidden: false,
            edit: { type: 'text', required: true, keep: true },
          },
          {
            field: 'attributes',
            title: '属性',
            type: 'string',
            width: 150,
            align: 'left',
          },
          {
            field: 'spare14',
            title: 'pms房价码',
            type: 'string',
            width: 120,
            align: 'left',
            hidden: true,
            edit: { type: 'text' },
          },
          {
            field: 'regular_bus_detail',
            title: '时间点',
            type: 'text',
            width: 120,
            align: 'left',
            hidden: true,
            edit: {
              type: 'selectList',
              key: 'pointTime',
              data: [],
              keep: true,
            },
          },
          {
            field: 'stockTotal',
            title: '总库存',
            type: 'string',
            width: 120,
            align: 'left',
            edit: { type: 'text', keep: true },
            min: 0,
          },
          {
            field: 'num',
            title: '数量',
            type: 'int',
            width: 120,
            align: 'left',
            hidden: false,
            edit: { type: 'number' },
          },
          {
            field: 'creator',
            title: '创建人',
            type: 'string',
            width: 90,
            align: 'left',
            hidden: true,
          },
          {
            field: 'createDate',
            title: '创建时间',
            type: 'datetime',
            width: 160,
            align: 'left',
            sortable: true,
            hidden: true,
          },
          {
            field: 'createID',
            title: '创建人ID',
            type: 'int',
            width: 90,
            hidden: true,
            align: 'left',
          },
          {
            field: 'modifier',
            title: '修改人',
            type: 'string',
            width: 90,
            align: 'left',
            hidden: true,
          },
          {
            field: 'modifyDate',
            title: '修改时间',
            type: 'datetime',
            width: 160,
            align: 'left',
            sortable: true,
            hidden: true,
          },
          {
            field: 'modifyID',
            title: '修改人ID',
            type: 'int',
            width: 90,
            hidden: true,
            align: 'left',
          },
          {
            field: 'id',
            title: '主键',
            type: 'string',
            width: 120,
            hidden: true,
            readonly: true,
            align: 'left',
          },
          {
            field: 'goodid',
            title: '主键',
            type: 'string',
            width: 120,
            hidden: true,
            readonly: true,
            require: true,
            align: 'left',
          },
          {
            field: 'breakfast_count',
            title: '含早餐',
            type: 'integer',
            identifying: true,
            width: 80,
            hidden: true,
            require: true,
            align: 'left',
            edit: { type: 'integer', keep: true },
          },
        ],
        sortName: 'code',
        key: 'goodId',
      },
    }
  },
}
export default vueParam
</script>
